package com.miniprogram.common.utils;

import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateTime;

import java.util.Date;

public class DateUtils {

    public static int betweenHour(Date beginDate, int endHour) {
        DateTime dateTime = new DateTime(beginDate);
        int beginHour = dateTime.getField(DateField.HOUR_OF_DAY);
        return endHour - beginHour;
    }

    public static int betweenHour(int beginHour, Date endDate) {
        DateTime dateTime = new DateTime(endDate);
        int endHour = dateTime.getField(DateField.HOUR_OF_DAY);
        return endHour - beginHour;
    }

}